package org.web.clientlistmanager.client.biz;

import io.netty.channel.ChannelHandlerContext;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Component;
import org.web.clientlistmanager.sdk.dto.ClmRequest;
import org.web.clientlistmanager.sdk.event.EventInterface;

import javax.annotation.Resource;

@Component("clmReportSelfAgainEvent")
public class ClmReportSelfAgainEvent implements EventInterface {

    private static final Logger logger = LogManager.getLogger(ClmNettyClientHandler.class);

    @Resource
    private ClmClientMonitor clientMonitor;

    /**
     * 重新设置注册标识。
     */
    @Override
    public void executeRequest(ClmRequest clmRequest, ChannelHandlerContext ctx) {
        logger.info("Received report self again event");
        clientMonitor.hasReportSelf = false;
    }
}
